3.33 \(\int \cos ^2(e+f x) (-2+\sec ^2(e+f x)) \, dx\)

Optimal. Leaf size=17 \[ -\frac{\sin (e+f x) \cos (e+f x)}{f} \]

[Out]

-((Cos[e + f*x]*Sin[e + f*x])/f)

________________________________________________________________________________________

Rubi [A]  time = 0.0226518, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.053, Rules used = {4043} \[ -\frac{\sin (e+f x) \cos (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^2*(-2 + Sec[e + f*x]^2),x]

[Out]

-((Cos[e + f*x]*Sin[e + f*x])/f)

Rule 4043

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(A*Cot[e
 + f*x]*(b*Csc[e + f*x])^m)/(f*m), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[C*m + A*(m + 1), 0]

Rubi steps

\begin{align*} \int \cos ^2(e+f x) \left (-2+\sec ^2(e+f x)\right ) \, dx &=-\frac{\cos (e+f x) \sin (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0128307, size = 33, normalized size = 1.94 \[ -\frac{\sin (2 e) \cos (2 f x)}{2 f}-\frac{\cos (2 e) \sin (2 f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^2*(-2 + Sec[e + f*x]^2),x]

[Out]

-(Cos[2*f*x]*Sin[2*e])/(2*f) - (Cos[2*e]*Sin[2*f*x])/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 18, normalized size = 1.1 \begin{align*} -{\frac{\cos \left ( fx+e \right ) \sin \left ( fx+e \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^2*(-2+sec(f*x+e)^2),x)

[Out]

-cos(f*x+e)*sin(f*x+e)/f

________________________________________________________________________________________

Maxima [A]  time = 0.927954, size = 31, normalized size = 1.82 \begin{align*} -\frac{\tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(-2+sec(f*x+e)^2),x, algorithm="maxima")

[Out]

-tan(f*x + e)/((tan(f*x + e)^2 + 1)*f)

________________________________________________________________________________________

Fricas [A]  time = 0.466091, size = 41, normalized size = 2.41 \begin{align*} -\frac{\cos \left (f x + e\right ) \sin \left (f x + e\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(-2+sec(f*x+e)^2),x, algorithm="fricas")

[Out]

-cos(f*x + e)*sin(f*x + e)/f

________________________________________________________________________________________

Sympy [A]  time = 52.3263, size = 49, normalized size = 2.88 \begin{align*} x - 2 \left (\begin{cases} \frac{x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{x \cos ^{2}{\left (e + f x \right )}}{2} + \frac{\sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \cos ^{2}{\left (e \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**2*(-2+sec(f*x+e)**2),x)

[Out]

x - 2*Piecewise((x*sin(e + f*x)**2/2 + x*cos(e + f*x)**2/2 + sin(e + f*x)*cos(e + f*x)/(2*f), Ne(f, 0)), (x*co
s(e)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.13889, size = 20, normalized size = 1.18 \begin{align*} -\frac{\sin \left (2 \, f x + 2 \, e\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^2*(-2+sec(f*x+e)^2),x, algorithm="giac")

[Out]

-1/2*sin(2*f*x + 2*e)/f